import QtQuick 2.15
import QtQuick.Controls 2.15
import '../component'
ApplicationWindow{
	id : root
	width: 700
	height: 800
	visible: true
	property int duration: 3000
	ClickableImage2{
		id : rocket1
		x: 20;y : 140
		source: '/resources/img/rocket.png'
		onClicked: anim.start()
	}
	ParallelAnimation{
		id : anim
		NumberAnimation{
			target: rocket1
			properties: 'y'
			to: 20
			duration:root.duration
		}
		NumberAnimation{
			target: rocket1
			properties: 'x'
			to: 160
			duration:root.duration
		}
	}
	ClickableImage2 {
		id: rocket2
		x: 120; y: 220
		source: "/resources/img/rocket.png"
		onClicked: anim2.restart()
	}
	
	SequentialAnimation {
		id: anim2
		NumberAnimation {
			target: rocket2
			properties: "y"
			to: 120
			// 60% of time to travel up
			duration: root.duration*0.6
		}
		NumberAnimation {
			target: rocket2
			properties: "x"
			to: 260
			// 40% of time to travel sideways
			duration: root.duration*0.4
		}
	}
}
